'use strict';{var _Lu=function(c,d={},a,g){return _Bj(_lo)`<iconPick name="${c}" value=$${d} ${a?`iconUID=${a}`:d.img?`img style="--img: url(${d.img})"`:""} ${g?`use=${g}`:""} title="Enter an icon"></iconPick>`},_yp=function(c,d){let a=_ih(c,"value"),g=$(`\n <optPane iconEdit value={} helpCtx=/iconPick>\n <div symb><l>Symbol:</l> <btnFld>${_if("symbol",a.symbol,"","maxlength=6")}<b btn></b></btnFld> <h h=sym></h>\n <trans name=trans value="${a.trans||""}" dontFocus>\n <btn i=&#59780; trans=RL title="Rotate left" style="--scaleHorz: -1"></btn>\n <btn i=&#59780; trans=RR title="Rotate right"></btn>\n <btn i=&#60138; trans=FH title="Flip horizontal"></btn>\n <btn i=&#60138; trans=FV title="Flip vertical" style="--rot: 90deg"></btn>\n </trans> </div>\n <div><l>Color:</l> <input type=color name=color ${a.color?
`value="${a.color}"`:""}></div>\n <div><l><label>${_io("",a.bgColor)}Back color:</label></l> <input type=color name=bgColor ${a.bgColor?`value="${a.bgColor}"`:"greyedout"}></div>\n <div btns><button url>URL...</button> <button file>File...</button> <h h=img></h></div>\n </optPane>\n `),l=$("[name=symbol]",g)[0],e=b=>{l.value=b;g.find("[name=trans]").attr("value","");k()},k=_Et(function*(){if(document.contains(g[0])){a=c.value={img:a.img}.add(_pu(g[0]));if(a.symbol&&a.symbol.replace(/\u200E|\u200F/g,
"")){let b=(a.trans||"").trim().split(/\s+/);+b[0]&&(b[0]={rotate:+b[0]});b[1]&&(b[1]={resize:"-100% 100%"});a.img=yield _Mr(d,a.symbol,a.color,a.bgColor,$(l).css("font-family"),b)}$(c).triggerEvt("change",!0)}});$(l).on("input",function(){this.value||delete a.img});return g.on("click","btnFld [btn]",function(){let b=[...l.value][0],f=_Bj(_lo)`\n <symbolSelect>\n ${"\ud83c\udfe0\ue9c9\ue9ca\ue9cb\uea80\uea82\ud83d\udcac\ue902\ue904\ue9b6\ue9b7\ud83d\udca1\ud83d\udd26\ue903\ud83d\udd27\ud83d\udd28\u2692\u2702\ud83d\udcce\ud83d\udccb\ud83d\udccc\ud83d\udeaa\uea14\uea13\ue9ac\ue999\ue9a9 \u2315\ud83d\udd0e\ud83d\udd0d\ue987\ue988\ue9cf\ue9d0\ue985\ud83d\udd03\uea2e\ue9c2\ue9c3\ud83d\udce4\ud83d\udce5\ue95e\ue95f\ue95c\uea25\ud83d\udcbe\ud83d\udcc1\ud83d\udcc2\ue931\ue932\ud83d\udcbc\ue901\ue955\u2328 \ue935\ue936\ue9d2\ue9d3\ue9cc\ud83d\udea9\ue948\u2709\ud83d\udce7\ud83d\udce8\ud83d\udce9\ud83d\udcea\ud83d\udceb\u231a\u231b\u23f3\u23f0\ud83d\udd52\ud83d\udd14\u26a0\u26d4\ud83d\udd11\ud83d\udd10\ud83d\udd12\ud83d\udd13\ue990\ud83c\udfe5\ue941 \ue9b9\uea71\ue99a\ue90d\ue913\ud83c\udfac\u266a\u266b\ud83d\udce2\uea27\uea2b\uea2c\uea2a\ud83c\udfa7\ud83c\udfa4\ud83c\udfb8\ud83c\udfb9\ud83d\udcde\u260e\ud83d\udcf1\ue958\ud83d\udcbb\ud83d\udcfa\ue95b\ud83c\udfae\ud83d\udcf7\ud83c\udfa5\ud83d\udce1 \ue93a\ud83c\udfec\ud83d\udce6\u26fd\ud83c\udfc1\ud83c\udfc6\u26bd\u26be\ud83c\udfc8\ud83c\udfb2\ud83d\udc8e\ud83d\udcb0\ud83d\udd2b\ud83d\udc87\ud83c\udf93\ud83d\udc54\ud83d\udc53\u270d\ud83d\udcda\ud83d\udcd5\ud83d\udcd6\u270f\u270e\ud83d\udcd0\ud83c\udfa8\ud83c\udf92 \u2714\u2795\u274c\u2327\u2326\ueaea\uea7d\uea7e\ue989\ue98a\ue98b\ue98c\uea87\uea88\uea2d\u292a\u2928\u2927\u2929\uea30\ud83d\udd19\ud83d\udd1a\ud83d\udd1c\ud83d\udd1d \u2190\u2192\u2191\u2193\u2b05\u27a1\u2b06\u2b07\u2196\u2197\u2198\u2199\u2195\u2194\u2921\u2922\u21e0\u21e2\u21e1\u21e3\u21a4\u21a5\u21a6\u21a7\u2912\u2913\u21e4\u21e5 \u21b0\u21b1\u21b2\u21b3\u21b4\u21b5\u2934\u2935\u2936\u2937\u21a9\u21aa\ue967\ue968\ue969\ue96a\u2938\u2939\u293a\u293b\u21b6\u21b7\u293e\u293f\ue965\ue966\ue984\u21ba\u21bb\u27f2\u27f3\u2940\u2941 \u21c4\u21c6\u21c7\u21c9\u21c8\u21ca\u21c5\u21d0\u21d2\u21d1\u21d3\u21d4\u21d5\u21d6\u21d7\u21d8\u21d9\u21da\u21db\u290a\u290b\u21e6\u21e8\u21e7\u21e9\u21f3\u23ce\u300a\u300b\u2303\u2304 \u25c0\u25b6\u25b2\u25bc\u23ea\u23e9\u23eb\u23ec\uea21\uea22\uea23\uea24\u25e4\u25e5\u25e3\u25e2 \uea15\uea16\uea17\uea18\uea19\uea1a\uea1b\uea41\uea42\uea43\uea44\u261a\u261b\u261d\u261f\u261c\u261e\ud83d\udc46\ud83d\udc47\ud83d\udc48\ud83d\udc49\u27a5\u27a6\u27a9\u27aa \u235f\u272a\u2605\u2606\u2736\u2724\u233e\u25d0\u25d1\u25d2\u25d3\u2756\u0fcf \u2ff0\u2ff1\u2ff2\u2ff3\u2ff4\u2ff5\u2ff6\u2ff7\u2ff8\u2ff9\u2ffa\u2ffb \ud83d\udeb2\ud83d\ude97\ud83d\ude8c\ud83d\ude9a\ud83d\ude91\u2708\ud83d\ude80\u2638\u2693\ud83d\udea2\ud83d\udea4\u26f5 \ud83c\udf4e\ud83c\udf52\ud83c\udf57\ud83c\udf69\ud83c\udf54\ud83c\udf55\ud83c\udf66\ud83c\udf77\ud83c\udf78\u2615\ud83c\udf74\ud83c\udf82\ud83c\udf81\ud83c\udf84\ud83c\udf85\u26c4\ud83c\udf83\u2620\u262f\u262e\u267b\u2622\ud83d\udca5\ud83d\udca3 \u263c\u2600\u263d\ud83c\udf19\u2601\u26c5\u2744\ue9b5\u2602\ud83c\udf02\ud83c\udf40\ud83c\udf41\ud83c\udf42\u2741\u2740\u273f \ud83d\udc36\ud83d\udc31\ud83d\udc2c\ud83d\udc24\ud83d\udc26\ud83d\udc27\ud83d\udc0e\ud83d\udc18\ud83d\udc1f\ud83d\udc0c \u2665\u2666\u2663\u2660\u265f\u265e\u265d\u265c\u265b\u265a \ud83d\udc64\ud83d\udeb6\ud83c\udfc3\ud83d\udc6b\ud83d\udc6a\ud83d\udc68\ud83d\udc69\ud83d\udebc\u267f\ud83d\udc6e \u270b\ud83d\udc4f\ud83d\udc4b\ud83d\udc4c\u270c\ud83d\udc4d\ud83d\udc4e\ud83d\udc40\ud83d\udc42\ud83d\udc43 \u263b\u263a\u2639\ud83d\ude0a\ud83d\ude09\ud83d\ude24\ud83d\ude01\ud83d\ude0d\ud83d\ude0e\ud83d\ude07\ud83d\ude08\ud83d\udc7d\ud83d\udc80\ud83d\udca9".split(" ").map(h=>
_Bj`<table>${[...h].map((m,n)=>(n%14?"":"<tr>")+`<td ${m==b?"selected":""}>`+m)}</table>`)}\n <more>Find more symbols and emojis at <a href="https://getemoji.com">getemoji.com</a></more>\n </symbolSelect>\n `.on("mousedown","td",function(){$(this).closest("symbolSelect").find("[selected]").attr("selected",null);$(this).attr("selected","");e(this.innerText)});_Jh(f,this.closest("div"),"brtl","tailAndShadow noTail");$("[selected]",f).each(function(){this.scrollIntoViewIfNeeded(!0)})}).on("mousedown",
"trans btn",_Et(function*(b){if(l.value){let [f,h]=($(this).parent().attr("value")||"").split(" "),[m,n]={RL:[-45],RR:[45],FH:[0,!0],FV:[180,!0]}[$(this).attr("trans")];h=!h!=!n;f=((f|0)+(h?-1:1)*m+360)%360;$(this).parent().attr("value",`${f} ${h?"F":""}`);b.preventDefault()}else a.img&&(b={RL:{rotate:270},RR:{rotate:90},FH:{resize:"-100% 100%"},FV:{resize:"100% -100%"}}[$(this).attr("trans")],a.img=(yield _4(yield _kw(a.img),[b])).toDataURL());$(this).triggerEvt("change",!0)})).on("change","[type=checkbox]",
function(b){$("[name=bgColor]",b.delegateTarget).attr("greyedout",this.checked?null:"")}).on("click","[file]",_Et(function*(){let b=yield _Kd("image/*","dataUri");a.img=yield _ta(b,16,16);e("")})).on("click","[url]",()=>{_Yo("Enter icon URL",'\n Enter the address of a website, web page or image. <hr b=2>\n URL: <input type=text name=url size=50 spellcheck=false placeholder="example.com">\n ',{yes:"OK",no:"Cancel",icon:"none",width:"initial",enterOk:!0})((b,f)=>{if(b){b=(f.url||"").trim();if(!b)return!0;
_Zk(b)||(b="http://"+b);_pg(!0);p(b)(h=>{_pg(!1);h?(a.img=h,e("")):_yt("Invalid or unreachable URL.",{type:"error"})})}})}).on("input","[type=color]",_se(-200,k)).on("change",k)},_Mr=(c,d,a,g,l="sans-serif",e)=>k=>{let b=16,f=1;49==_Ok&&"tbBtn"==c&&(b=19,f=2);q(d,e,a,g,b,f,`33px/2 ${l}`,25)(h=>k(h.toDataURL()))};let p=_wj(function*(c){try{var d=yield _n(c,"","HEAD")}catch(g){return""}var a=d.getResponseHeader("content-type");d=d.getResponseHeader("content-length");if(a&&a.match(/^image/i)&&(!d||5E5>
d))return yield _ta(c,16,16);a=_Tu(c);d=yield _n(a,"dataUri");return a==_7y||_0j(c)||d!=(yield _n(_7y,"dataUri"))?d:yield _n("https://www.google.com/s2/favicons?domain_url="+c,"dataUri")}),q=_wj(function*(c,d,a,g,l,e,k,b){e=l-(g?2*e:0);let f=c&&1==[...c].length;document.documentElement.style.display="block";a=_Ts(c,k,a,f?void 0:e);d&&(a=yield _4(a,d));a.width&&a.height||_6p("textToIcon 0 width/height",{text:c,fontStyle:k,isSingleChar:f,contentSize:e,transforms:d});a=r(a);f?(c=Math.max(a.width,a.height),
c>e&&(c/=e,a=yield _4(a,[{resize:`${Math.round(a.width/c)} ${Math.round(a.height/c)}`}]))):a.height>e&&(a=yield _4(a,[{resize:`${Math.min(a.width,e)} ${e}`}]));c=l-a.height;l-=a.width;d=c/2|0;k=l/2|0;return yield _4(a,[{margin:`${c-d} ${l-k} ${d} ${k}`},{background:g},{cornerRadius:g?b:0}])}),r=function(c){var d=c.width;const a=c.height,g=c.getContext("2d"),l=g.getImageData(0,0,d,a).data;var e=d;let k=a,b=0;var f=0;for(let h=0;h<d;++h)for(let m=0;m<a;++m)l[4*(m*d+h)+3]&&(h<e&&(e=h),m<k&&(k=m),h>b&&
(b=h),m>f&&(f=m));d=b-e+1;f=f-k+1;e=g.getImageData(e,k,d,f);c.width=d;c.height=f;g.putImageData(e,0,0);return c}};
